
<%@ page import="module.config.ValueConfig" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'valueConfig.label', default: 'ValueConfig')}" />
  <title><g:message code="default.list.label" args="[entityName]" /></title>
</head>
<body>
  <div class="nav">
    <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">首页</a></span>
    <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
  </div>
  <div class="body">   
    <h1>
      <g:form>
        检查配置项     <span class="button"><g:actionSubmit class="update" action="updateConfig" value="更新" onclick="return confirm('确定要更新？');" /></span>
      </g:form>
    </h1>
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    <div class="list">
      <table>
        <thead>
          <tr>

        <g:sortableColumn property="id" title="${message(code: 'sysConfig.id.label', default: 'Id')}" />

        <g:sortableColumn property="title" title="${message(code: 'sysConfig.title.label', default: 'Title')}" />

        <g:sortableColumn property="propertyName" title="${message(code: 'sysConfig.propertyName.label', default: 'Property Name')}" />

        <g:sortableColumn property="propertyValue" title="${message(code: 'sysConfig.propertyValue.label', default: 'Property Value')}" />

        <th>当前配置值</th>

        <g:sortableColumn property="lastUpdated" title="${message(code: 'sysConfig.lastUpdated.label', default: 'Last Update')}" />

        </tr>
        </thead>
        <tbody>
        <g:each in="${sysConfigInstanceList}" status="i" var="sysConfigInstance">
          <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

            <td><g:link action="show" id="${sysConfigInstance.id}">${fieldValue(bean: sysConfigInstance, field: "id")}</g:link></td>

          <td>${fieldValue(bean: sysConfigInstance, field: "title")}</td>

          <td>${fieldValue(bean: sysConfigInstance, field: "propertyName")}</td>

          <td>${fieldValue(bean: sysConfigInstance, field: "propertyValue")}</td>

          <td style="background-color: ${config[sysConfigInstance?.propertyName]==sysConfigInstance?.propertyValue?'#ccffcc':'#ffcccc'}">${config[sysConfigInstance?.propertyName]}</td>

          <td><g:formatDate date="${sysConfigInstance.dateCreated}" /></td>

          </tr>
        </g:each>
        </tbody>
      </table>
    </div>
    <div class="paginateButtons">
      <g:paginate total="${sysConfigInstanceTotal}" />
    </div>
  </div>
</body>
</html>
